﻿using System;
using System.Collections.Generic;
using Stauffware.Common.Console;
using Stauffware.Common.Console.New;
using CLP=Stauffware.Common.Console.New;

// Parameters for this application, 
// provided via the command line.
public class MyAppParams
{
	[CmdLineArg(Required=true)]
	public List<string> InputFiles;
	public string OutputFile;
	public bool Verbose;
	public int MaxErrors = 100;
}

class MyProgram
{
	static MyAppParams AppParams = new MyAppParams();

	static int Main (string[] cmdLineArgs)
	{
		CLP.CmdLineParser clp = new CLP.CmdLineParser(AppParams);
		try
		{
			clp.ParseCmdLine(cmdLineArgs);
		}
		catch (CmdLineSyntaxError err)
		{
			Console.Error.WriteLine(err.Message);
			return 1;
		}

		// ... the rest of your program ...

		return 0;	// success
	}
}
